home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / rogue / patch1 / Bugs next >
Encoding:
Text File  |  1987-05-30  |  5.7 KB  |  202 lines

  1.  
  2. Here is a list of fixes for bugs and non-portable items found in my
  3. rogue clone.  Many thanks to those who reported the problems, I would
  4. appreciate any further reports, particularly if the stuff below does
  5. not fix what it is intended to fix.
  6.             Tim Stoehr
  7.             tims@zeus.TEK.COM
  8.     ----------------------------------------------------
  9.  
  10.  1.)    To implement the ',' command, which allows the rogue to pick up
  11.         an item he is currently standing on, do the following:
  12.             a.)   Add the following case into the large switch statement
  13.                   in the routine play_level() in play.c:
  14.                   case ',':
  15.                         kick_into_pack();
  16.                         break;
  17.             b.)  Add the following routine at the bottom of pack.c:
  18.  
  19. kick_into_pack()
  20. {
  21.     object *obj;
  22.     char desc[DCOLS];
  23.     short n, stat;
  24.  
  25.     if (!(dungeon[rogue.row][rogue.col] & OBJECT)) {
  26.         message("nothing here", 0);
  27.     } else {
  28.         if (obj = pick_up(rogue.row, rogue.col, &stat)) {
  29.             get_desc(obj, desc);
  30.             if (obj->what_is == GOLD) {
  31.                 message(desc, 0);
  32.                 free_object(obj);
  33.             } else {
  34.                 n = strlen(desc);
  35.                 desc[n] = '(';
  36.                 desc[n+1] = obj->ichar;
  37.                 desc[n+2] = ')';
  38.                 desc[n+3] = 0;
  39.                 message(desc, 0);
  40.             }
  41.         }
  42.         if (obj || (!stat)) {
  43.             (void) reg_move();
  44.         }
  45.     }
  46. }
  47.  
  48.  2.)    In score.c, there is a bug.  In the routine get_value(), add the
  49.         following case to the existing switch statement:
  50.  
  51.         case RING:
  52.             val = id_rings[wc].value * (obj->class + 1);
  53.             break;
  54.  
  55.  3.)    In message.c, change any occurrence of %D to %ld, for portability.
  56.  
  57.  4.)    In message.c, there is a line that looks like:
  58.  
  59.         sprintf(buf, "%d", rogue.gold);
  60.         or
  61.         sprintf(buf, "%D", rogue.gold);
  62.  
  63.         Change this line to:
  64.  
  65.         sprintf(buf, "%ld", rogue.gold);
  66.  
  67.         Do the same for the line in score.c, in the routine killed_by(),
  68.         which looks like this:
  69.  
  70.         sprintf(buf+strlen(buf), "%d gold", rogue.gold);
  71.  
  72.         That is, change the %d (or %D) to %ld.
  73.  
  74.  5.)    In message.c, delete the line in rgetchar(), that looks like this:
  75.  
  76.             printf(CL);
  77.  
  78.         if CL is undefined during compilation.
  79.  
  80.  6.)    Delete the routine free_free_list() in object.c, and any calls to it.
  81.  
  82.  7.)    In the Makefile, UNIX_SYSV (system V) folks may not need -ltermlib.
  83.         And folks with Microport sysV for PC/AT's will need to link with -Ml.
  84.  
  85.  8.)    In move.c, in the function gr_dir(), add break clauses to each of
  86.         the cases in the switch statement.  This is a bug.
  87.  
  88.  9.)    In init.c, change the global variable restore_file to rest_file, as
  89.         well as all occurrences of that variable in init.c.
  90.         This keeps some linkers from confusing the name 'restore_file' with
  91.         the routine called 'restore' in save.c.
  92.  
  93. 10.)    Replace your version of the function get_rand() in random.c with
  94.         the version given below.  This is extremely important for machines
  95.         with 16-bit (as opposed to 32-bit) integers.
  96.  
  97. get_rand(x, y)
  98. register int x, y;
  99. {
  100.     register int r, t;
  101.     long lr;
  102.  
  103.     if (x > y) {
  104.         t = y;
  105.         y = x;
  106.         x = t;
  107.     }
  108.     lr = rrandom();
  109.     lr &= (long) 0x00007fff;
  110.     r = (int) lr;
  111.     r = (r % ((y - x) + 1)) + x;
  112.     return(r);
  113. }
  114.  
  115. 11.)    In level.c, replace the declaration and initialization of
  116.         random_rooms with the following:
  117.  
  118.         short random_rooms[MAXROOMS] = {3, 7, 5, 2, 0, 6, 1, 4, 8};
  119.  
  120.         This is probably just cosmetic.
  121.  
  122. 12.)    In zap.c, replace the function tele_away() with the following version:
  123.  
  124. tele_away(monster)
  125. object *monster;
  126. {
  127.     short row, col;
  128.  
  129.     if (monster->m_flags & HOLDS) {
  130.         being_held = 0;
  131.     }
  132.     gr_row_col(&row, &col, (FLOOR | TUNNEL | STAIRS | OBJECT));
  133.     mvaddch(monster->row, monster->col, monster->trail_char);
  134.     dungeon[monster->row][monster->col] &= ~MONSTER;
  135.     monster->row = row; monster->col = col;
  136.     dungeon[row][col] |= MONSTER;
  137.     monster->trail_char = mvinch(row, col);
  138.     if (detect_monster || rogue_can_see(row, col)) {
  139.         mvaddch(row, col, gmc(monster));
  140.     }
  141. }
  142.  
  143.  13.)    In init.c, replace the function start_window() with the following
  144. version:
  145.  
  146. start_window()
  147. {
  148.     crmode();
  149.     noecho();
  150. #ifndef BAD_NONL
  151.     nonl();
  152. #endif BAD_NONL
  153.     md_control_keybord(0);
  154. }
  155.  
  156.         The symbol BAD_NONL is to be defined during compilation on systems
  157.     whose curses library has a buggy nonl() function/macro.  This may
  158.     be noticed if the game draws things on the wrong lines, particularly
  159.     during score file display.  Nonl() is not really necessary, although
  160.     it is a nice optimization for curses.
  161.  
  162.  14.) In the routine inventory() in inventory.c:
  163.  
  164.     for (j = 1; j < i; j++) {
  165.         mvaddstr(j, col, descs[j-1]);
  166.     }
  167.  
  168. should be changed to:
  169.  
  170.     for (j = 1; ((j < i) && (j < DROWS)); j++) {
  171.         mvaddstr(j, col, descs[j-1]);
  172.     }
  173.  
  174.     This might cause some problems if the player fills his pack and has no
  175.     duplicate items.  The inventory, plus prompt line, would go one line
  176.     past the status line.
  177.  
  178.  15.) Some compilers are sensitive about names after a #endif, e.g.
  179.     #ifdef NAME
  180.     #endif NAME
  181. If this happens to you, simply change #endif NAME to #endif /* NAME */.
  182.  
  183.  16.) [Optional] For general cleanup, in rogue.h insert the following
  184.     just prior to the #endif CURSES line (at the end of the file):
  185.  
  186.     #else
  187.     #include <curses.h>
  188.  
  189. Then delete the three lines:
  190.  
  191.     #ifndef CURSES
  192.     #include <curses.h>
  193.     #endif CURSES
  194.  
  195. that appear at the top of every file except main.c, random.c and ring.c.
  196.  
  197.  17.) Replace the file machdep.c with the one included in this posting.
  198.  
  199.  18.) Create a new file "patchlevel.h" that has a single line in it:
  200.  
  201.     #define PATCHLEVEL 1
  202.